~ chicken-core (chicken-5) /manual/Module (chicken errno)
Trap1[[tags: manual]]2[[toc:]]34== Module (chicken errno)56This module provides access to the standard C {{errno}} value.78Be careful, if you're using threads, {{errno}} might be clobbered as9soon as another thread calls a C function. To prevent this from10happening, you can add {{(declare (disable-interrupts))}} at the top11of your file, or use the {{-disable-interrupts}} compiler option to12avoid any context switches while a procedure in this file is running.1314=== errno1516<procedure>(errno)</procedure>1718Returns the error code of the last system call.1920=== errno constants2122<constant>errno/perm</constant><br>23<constant>errno/noent</constant><br>24<constant>errno/srch</constant><br>25<constant>errno/intr</constant><br>26<constant>errno/io</constant><br>27<constant>errno/noexec</constant><br>28<constant>errno/badf</constant><br>29<constant>errno/child</constant><br>30<constant>errno/nomem</constant><br>31<constant>errno/acces</constant><br>32<constant>errno/fault</constant><br>33<constant>errno/busy</constant><br>34<constant>errno/notdir</constant><br>35<constant>errno/isdir</constant><br>36<constant>errno/inval</constant><br>37<constant>errno/mfile</constant><br>38<constant>errno/nospc</constant><br>39<constant>errno/spipe</constant><br>40<constant>errno/pipe</constant><br>41<constant>errno/again</constant><br>42<constant>errno/rofs</constant><br>43<constant>errno/exist</constant><br>44<constant>errno/wouldblock</constant>4546These variables contain error codes as returned by {{errno}}.4748''NOTE'': On Windows, {{EWOULDBLOCK}} does not exist. For49consistency, {{errno/wouldblock}} does exist, but it is defined as50zero.5152This does mean that in case there is no error, it looks like the53{{errno/wouldblock}} error is returned. But you have to check the54return code of a system call before accessing {{errno}} anyway, so55this should typically never happen.5657---58Previous: [[Module (chicken csi)]]5960Next: [[Module (chicken eval)]]